<div class="clearfix row-main" ng-controller="roleCtrl">
	<div class='panel'>
		<div class="panel-heading clearfix" style="padding-bottom: 4px;" >
			<ul id='typeNav' class='nav nav-tabs pull-left'>
				<li data-type='internal' ng-class="{active:isSelected(1)}"><a href="javascript:void(0)" > 全部角色</a></li>
			</ul>

			<div class="panel-actions">
				<a href='javascript:void(0)'  class='btn' ng-click='init()'><i class="icon icon-refresh"></i></a>
				<a href='javascript:void(0)'  class='btn btn-info' ng-show='useBatchSave' ng-click='batchSave()'><i class='icon icon-plus'></i>批量保存</a>
				<form method='get' class='form-inline form-search'>
					<div class="input-group">
						<input type='text' class='form-control search-query' placeholder='请输入搜索内容' /> 
						<span class="input-group-btn"> 
							<input type='submit' class='btn' id='search' value='搜索' ng-click="init()" data-loading='稍候...' />
						</span>
					</div>
				</form>
				<a href='javascript:void(0)'  class='btn btn-primary' ng-click='addRow()'><i class='icon icon-plus'></i> 添加角色</a>
			</div>
		</div>
	  <!-- 全部 -->
		<table id="data-list" class='table table-hover table-striped tablesorter' data-ng-init="loadList(pageNow, pageSize)">
			<thead>
				<tr class='text-center'>
					<th class='w-60px text-left'>&nbsp;<input type="checkbox" ng-click="checkAll($event)" />&nbsp;</th>
					<th class=''><div><a class='header' data-sort='role_name'  ng-click='sortFun($event)' href='javascript:void(0)' >名称</a></div></th>
					<th class=''><div><a class='header' data-sort='coding' ng-click='sortFun($event)' href='javascript:void(0)' >编码</a></div></th>
					<th class='w-60px'><div><a class='header' data-sort='seq' ng-click='sortFun($event)' href='javascript:void(0)' >序号</a></div></th>
					<th class='w-140px'><div><a class='header' data-sort='ctime' ng-click='sortFun($event)' href='javascript:void(0)' >时间</a></div></th>
					<th class=''>操作</th>
				</tr>
			</thead>
			<tbody>
				<tr class="addRow hide text-center">
					<td class='text-left'>&nbsp;</td>
					<td><input class="text-center clear" name="role_name" /></td>
					<td><input class="text-center clear" name="coding" /></td>
					<td><input class="text-center clear" name="seq" /></td>
					<td><input class="text-center w-140px" disabled="true" name="role.ctime" placeholder="--" /></td>
					<td>
						<a class="icon icon-20px icon-check" title="确认" href="javascript:void(0)" ng-click="saveBtn($event)"></a>
						&nbsp;
						<a class="icon icon-20px icon-times" title="关闭" href="javascript:void(0)" ng-click="cancelAdd($event)"></a>
					</td>
				</tr>
				<tr class="updateRow hide text-center">
           			<td class='text-left'>&nbsp;</td>
					<td><input class="text-center clear" name="role_name" /></td>
					<td><input class="text-center clear" name="coding" /></td>
					<td><input class="text-center clear" name="seq" /></td>
					<td><input class="text-center w-140px" name="ctime" disabled="true" /></td>
					<td>
						<a class="icon icon-save icon-20px" title="保存" href="javascript:void(0)" ng-click=""></a>
						&nbsp;
						<a class="icon icon-times icon-20px" title="取消" href="javascript:void(0)" ng-click=""></a>
					</td>
				</tr>
					
				<tr class='text-center' ng-repeat="role in roleList" id="{{role.id}}" ng-click='hitRow($event)' >
					<td class='text-left'>&nbsp;<input type="checkbox" ng-click="checkSelect()" />&nbsp;{{$index+1}}</td>
					<td ng-bind="role.role_name"></td>
					<td ng-bind="role.coding"></td>
					<td ng-bind="role.seq"></td>
					<td ng-bind="role.ctime"></td>
					<td>
						<a href='javascript:void(0)' ng-click='editorBtn(this)'>编辑</a>
						<a href='javascript:void(0)' ng-click='del($event)'>删除</a>
						<a href='javascript:void(0)' ui-sref='rolePower({id:role.id})' >授权</a>
					</td>
				</tr>
				<tr ng-if="roleList.length==0" >
					<td colspan="7" class="text-center">暂无数据</td>
				</tr>
			</tbody>
			<tfoot ng-if="roleList.length!=0" >
				<tr>
					<td colspan='14'>
						<div class='btn-group'>
							<a class='btn btn-select-all check-all' href='javascript:;' ng-click='checkAll()' >全选</a>
							<a class='btn btn-select-reverse check-inverse' href='javascript:;' ng-click='reverse()' >反选</a>
						</div>
						<input type='button' class='btn btn-primary' value='删除' data-loading='稍候...' ng-show='useBatchStatus' ng-click='del()' />
						
						<ul class="pager" style='float: right; clear: none;' >
						  <li class="previous" ng-hide='isFirst()' ng-click="isFirst() || changePage(pageNow, -1)"><a href="javascript:void(0)">«</a></li>
						  <li ng-class="{active:isCurrent(pageNum)}" ng-click="changePage(pageNum, 0)" ng-repeat="pageNum in pageNumList">
						  	<a href="javascript:void(0)" ng-bind="pageNum"><span class="sr-only" ng-show="isCurrent(pageNum)">(current)</span></a>
						  </li>
						  <li class="next" ng-hide='isLast()' ng-click="isLast() || changePage(pageNow, 1)"><a href="javascript:void(0)" aria-label="Next">»</a></li>
						</ul>
						<div style='float: right; clear: none;' class='pager'>
							共 <strong ng-bind="totalRow"></strong> 条记录，
							<div class='dropdown dropup'>
								<a href='javascript:;' data-toggle='dropdown' id='_recPerPage' data-value='10'>每页 <strong ng-bind="pageSize"></strong> 条<span class='caret'></span></a>
								<ul class='dropdown-menu  pull-right'>
									<li ng-class='{active:item===pageSize}' ng-repeat='item in pageList'><a href='javascript:void(0)' ng-bind='item' ng-click='pageSizeSelectChange(item)'></a></li>
								</ul>
							</div>
							<strong>{{pageNow}}/{{totalPage}}</strong> &nbsp;&emsp;
						</div>
					</td>
				</tr>
			</tfoot>
		</table>
	</div>
</div>